/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufc.quixada.adrs.comandos.admin;

import br.ufc.quixada.adrs.interfaces.Comando;
import br.ufc.quixada.adrs.model.Adrs;
import br.ufc.quixada.adrs.service.AdrsService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 *
 * @author ismaily
 */
public class CmdCarregaAdrs implements Comando {

    public String executa(HttpServletRequest request, HttpServletResponse response) {

        HttpSession session = request.getSession();
        Long id = Long.parseLong(request.getParameter("id"));
        AdrsService as = new AdrsService();
        Adrs adrs = as.getAdrsById(id);
        session.setAttribute("adrsProdutor", adrs);
        return "/admin/admin_add_produtor_adrs.jsp";
    }
}
